package com.cj.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

@SuppressWarnings("serial")
public class Timecard extends Model<Timecard> {
	public static final Timecard me = new Timecard();
	
    public List<Timecard> getTimecardsByEmployee(Integer empId) {
    	String sql = "select * from timecard t left join employee e on t.empId = e.empId where e.empId = ?";
        return find(sql, empId);
    }
    
    public List<Timecard> getAllTimecards() {
		String sql = "select * from timecard t left join employee e on t.empId = e.empId";
		return find(sql);
	}
    
    public List<Timecard> getTimecardsByTime(Integer empId, String time) {
    	String sql = "select * from timecard where empId = ? and cardTime = ?";
    	return find(sql, empId, time);
    }
}
